/*
 * Copyright 2008 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.dopdf.document.model;

/**
 * This class is supposed to invoke a specific method on all elements of a collection.
 * It is not expected to return anything, hence the return type of evaluate is void.
 * For e.g. we want to invoke checkIn method on all AgreementItem instances then,
 * we just create an instance of ExpressionEvaluator and pass it as argument to CollectionUtils doInLoop method
 * and invoke the desired checkIn method on each entity instance.  For examples look at AgreementItemCollection code.
 *
 * @param <T> the generic type.  Could be any class such as AgreementItem or Reservation etc.
 * @author deep
 */
public interface ExpressionEvaluator<T> {

	/**
	 * This method will be invoked for every entity in the collection.
	 *
	 * @param entity the object, i.e. one of the instance in the collection.
	 */
	void evaluate(T entity);
}
